#ifndef IO_GRID
#define IO_GRID

#include <string.h>
#include <strings.h>
#include <stdio.h>
#include <dirent.h>
#include <sys/stat.h>
#include <sys/types.h>

#include "elements.h"


/* Stats */

struct stats {
	long int real_nodes_number;
	int alghoritm;
	long int start_area;
	long int final_area;
	long int start_bends;
	long int final_bends;
	long int start_length;
	long int final_length;
	double elapsed_time;
};
typedef struct stats stats;



/* Configuration*/

struct config {
	int alghoritm;
	long int* args;
	int end_mode;
};
typedef struct config config;

int save_grid(grid* gr, char* file_name );

grid* load_grid(char* file_name );

int scan_grids( char* directory, char*** file_names  );

void stats_update(char* file_name, stats* values );

config* load_config( char* directory );

#endif
